package com.tc.dispatch.csservice.algorithm.update;

import com.tc.dispatch.csservice.algorithm.similary.BasicSimilaryCalc;
import com.tc.dispatch.gsalgorithm.spec.*;
/**
 * <p>Title: </p>
 * <p>Description: </p>
 * <p>Copyright: Copyright (c) 2008</p>
 * <p>Company: zju</p>
 * @author jakcyjia
 * @version 1.0
 */

public class YieldUpdater extends BasicSimilaryCalc implements Updater {
  private static float[] gate={0.7f,0.5f,0.3f,0.1f};
  private static float[] _update={0.003f,0.005f,0.007f,0.01f};
  public YieldUpdater() {
  }
  public Float update(String A, String B,int[] weight) {
    return new Float(1);
   /*double value= super.calc(parse.parseSpec(A),parse.parseSpec(B),weight);

   if(value>0)
     return new Float(1-getUpdate(value));
   else
     return new Float(getUpdate(-value)+1);*/
  }
  private float getUpdate(double value)
  {
    int i=0;
    while(i<gate.length-1)
    {
      if(gate[i]<value)
	break;
      i++;
    }
    return _update[i];
  }

}